/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author YDZ
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';

const { adminPath } = useGlobSetting();

export interface WhPosInvStock extends BasicModel<WhPosInvStock> {
  invCode?: string; // 物料编码
  whcode?: string; // 仓库编码
  posCode?: string; // 货位编码
  iqty?: number; // 现存量
  cfree1?: string; // 自由项1
  cfree2?: string; // 自由项2
  cfree3?: string; // 自由项3
  companyCode?: string; // 公司
}

export const whPosInvStockList = (params?: WhPosInvStock | any) =>
  defHttp.get<WhPosInvStock>({ url: adminPath + '/wms/wh/pos/whPosInvStock/list', params });

export const whPosInvStockListData = (params?: WhPosInvStock | any) =>
  defHttp.post<Page<WhPosInvStock>>({
    url: adminPath + '/wms/wh/pos/whPosInvStock/listData',
    params,
  });

export const whPosInvStockListSumData = (params?: WhPosInvStock | any) =>
  defHttp.post<Page<WhPosInvStock>>({
    url: adminPath + '/wms/wh/pos/whPosInvStock/listSumData',
    params,
  });

export const whPosInvStockForm = (params?: WhPosInvStock | any) =>
  defHttp.get<WhPosInvStock>({ url: adminPath + '/wms/wh/pos/whPosInvStock/form', params });

export const whPosInvStockSave = (params?: any, data?: WhPosInvStock | any) =>
  defHttp.postJson<WhPosInvStock>({
    url: adminPath + '/wms/wh/pos/whPosInvStock/save',
    params,
    data,
  });

export const whPosInvStockDelete = (params?: WhPosInvStock | any) =>
  defHttp.get<WhPosInvStock>({ url: adminPath + '/wms/wh/pos/whPosInvStock/delete', params });
